/**
 * Created by LC on 2019/11/22
 */
package com.hw.paltfrom.controller.mainscreen;

import com.hw.paltfrom.rescode.HWSystemCode;
import com.hw.paltfrom.service.system.GisMapService;
import com.hw.paltfrom.utils.ResponeResultUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("gis")
public class GisMapController {

    @Autowired
    GisMapService gisMapService;

    @RequestMapping("station")
    public Map<String,Object> stationGis(String overrunCode){
        return gisMapService.findOverrun(overrunCode);
    }

    @RequestMapping("offsite")
    public Map<String,Object> offsiteGis(String areaId){
        if(StringUtils.isBlank(areaId)){
            return ResponeResultUtil.fail(HWSystemCode.PARAMS_ERROR);
        }
        return gisMapService.findOffsite(areaId);
    }

    @RequestMapping("enterprise")
    public Map<String,Object> enterpriseGis(String areaId){
        if(StringUtils.isBlank(areaId)){
            return ResponeResultUtil.fail(HWSystemCode.PARAMS_ERROR);
        }
        return gisMapService.findEnterprise(areaId);
    }

}
